<%@ page language="java" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>校园快递物流管理系统</title>  
    <link rel="stylesheet" href="<%=path%>/resource/css/pintuer.css">
    <link rel="stylesheet" href="<%=path%>/resource/css/admin.css">
    <link rel="stylesheet" href="<%=path%>/resource/bootstrap3/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="<%=path%>/resource/bootstrap3/css/bootstrap-theme.min.css"/>
    <script src="<%=path%>/resource/bootstrap3/js/jquery-1.11.2.min.js"></script>
    <script src="<%=path%>/resource/bootstrap3/js/bootstrap.min.js"></script>
    <script src="<%=path%>/js/pintuer.js"></script>
    <script src="<%=path%>/resource/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<div class="bg"></div>
<div class="container">
    <div class="line bouncein">
        <div class="x4 x4-move">
            <div style="height:150px;"></div>
            <div class="media media-y margin-big-bottom">           
            </div>         
            <form action="<%=path%>/login.action" name="ThisForm" method="post">
            <div class="panel loginbox">
                <div class="text-center margin-big padding-big-top"><h1>SSM校园快递物流管理系统</h1></div>
                <div class="panel-body" style="padding:30px; padding-bottom:10px; padding-top:10px;">
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="text" class="input input-big" name="userName" placeholder="登录账号" data-validate="required:请填写账号" />
                            <span class="icon icon-user margin-small"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="password" class="input input-big" name="userPw" placeholder="登录密码" data-validate="required:请填写密码" />
                            <span class="icon icon-key margin-small"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
							<select class="input input-big" name="userType">
											<option value="0">管理员</option>
											<option value="1">快递员</option>
											<option value="2">用户</option>
							</select>                                                   
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="text" class="input input-big" name="email" id="email" placeholder="邮箱" data-validate="required:请填写邮箱" />
                            <span class="icon icon-mail margin-small"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="field field-icon-right">
                            <input type="text" class="input input-big" name="mailCode" id="mailCode" placeholder="邮箱验证码" data-validate="required:请填写验证码" style="width:60%;display:inline-block;" />
                            <button type="button" class="button bg-main" style="vertical-align:top;margin-left:10px;" onclick="sendMailCode()">获取验证码</button>
                        </div>
                    </div>
                </div>
                <div style="padding-left:130px;">
                <input type="submit" class="button bg-main" value="登录">
                <a href="<%=path%>/reg.jsp"  class="button bg-main">注册</a>
                </div>
            </div>
            </form>          
        </div>
    </div>
</div>

<script>
function sendMailCode() {
    var email = document.getElementById("email").value;
    if (!email) { alert("请输入邮箱"); return; }
    fetch('sendMailCode?email=' + encodeURIComponent(email))
        .then(response => response.json())
        .then(data => alert(data.msg));
}
</script>

</body>
</html>